<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>

    #imgContainer{
        background-color: #cccccc;
        width: 500px;
        height: 500px;

    }

</style>
<body>
    <div id="imgContainer"></div>
    <div id="msg"></div>
</body>

<script>

var imgContainer,msgDiv;

window.onload = function () {
    imgContainer = document.getElementById('imgContainer');
    msgDiv  = document.getElementById('msg');

    imgContainer.ondragover = function (e) {
        e.preventDefault();
    }
    imgContainer.ondrop = function (e) {
        e.preventDefault();
        var f = e.dataTransfer.files[0];
        var fileReader = new FileReader();
        fileReader.onload = function (e) {
            showObj(e.target)
            imgContainer.innerHTML = "<img src=\""+fileReader.result+"\">";
        }
        fileReader.readAsDataURL(f);
    }
}

function showObj(obj) {
    var s ="";
    for(var k in obj){
        s+=k+":"+obj[k]+"<br/>"
    }
    msgDiv.innerHTML = s;
}
</script>
</html>